﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MINERP.NewProductBigPic
{
    public class DateTransfer
    {

        public static int RemarkInPicRightOrLeft { get; set; }
        public static int RemarkInPicBottomOrTop { get; set; }
        public static Bleed CurrentBleed
        {
            get
            {
                string str = Properties.Settings.Default.Bleed;
                if (string.IsNullOrEmpty(str))
                {
                    str = "0,0";
                }
                string[] bleedStrArr = str.Split(',');
                int ty = 0;
                double va = 0;
                if (bleedStrArr.Count() >= 2)
                {

                    try
                    {
                        ty = Convert.ToInt32(bleedStrArr[0]);
                        va = Convert.ToDouble(bleedStrArr[1]);
                    }
                    catch (Exception exception)
                    {
                    }
                }
                return new Bleed(ty, va);

            }
            set
            {
                if (value != null)
                {
                    string strVal = value.Type + "," + value.Value;
                  Properties.Settings.Default.Bleed=strVal;
                }
                else
                {
                   Properties.Settings.Default.Bleed= "0,0";

                }
                Properties.Settings.Default.Save();
            }
        }
        public static bool IsAutoCut { get; set; }
        public static bool TwoCutFlag { get; set; }
        public static int TextAlignType { get; set; }
    }
    public class Bleed
    {
        public Bleed(int t, double v)
        {
            Type = t;
            Value = v;
        }

        public int Type { get; set; }

        public string DisplayType
        {
            get
            {
                if (Type == 0)
                {
                    return "固定值";
                }
                else if (Type == 1)
                {
                    return "百分比";
                }
                else
                {
                    return "";
                }
            }
        }

        public double Value { get; set; }
    }
}
